﻿/**
 * Jean-François Desgagné 2009 Portfolio
 * Copyright (c) 2009 Jean-François Desgagné <jfesgagne@gmail.com>
 * 
 * This work is licensed under a Creative Commons Attribution 3.0 United States License.
 * Some Rights Reserved.
 */
package com.jfdesgagne.jfdesgagne09.modules.showcase.view {
    import com.jfdesgagne.jfdesgagne09.modules.showcase.ApplicationFacade;
    import com.jfdesgagne.jfdesgagne09.modules.showcase.view.component.Showcase;
     
    import org.puremvc.as3.multicore.interfaces.*;
    import org.puremvc.as3.multicore.patterns.mediator.Mediator;
    
    public class ShowcaseMediator extends Mediator implements IMediator {
        // Cannonical name of the Mediator
        public static const NAME:String = "ShowcaseMediator";

        public function ShowcaseMediator(viewComponent:Object) {
			super(NAME, viewComponent);
        }
		
		public static function getInstance():ShowcaseMediator {
			return ApplicationFacade.getInstance(ApplicationFacade.NAME).retrieveMediator(ShowcaseMediator.NAME) as ShowcaseMediator;
		}
		
		override public function listNotificationInterests():Array {
            return [ 
            		ApplicationFacade.INITIALIZE
                   ];
        }

        override public function handleNotification(note:INotification):void {
            switch (note.getName()) {
            	case ApplicationFacade.INITIALIZE:
					trace("LOADSLIDESHOWIMAGES");
					sendNotification(ApplicationFacade.LOADSLIDESHOWIMAGES, 11);
                break;
            }
        }
        
		public function get showcase():Showcase {
            return this.viewComponent as Showcase;
        }
    }
}